#include "StdAfx.h"
#include "AnimationRotatePirateShip.h"

CAnimationRotatePirateShip::CAnimationRotatePirateShip(void)
{
	m_time = 0;
	m_increment = 0.;
}

CAnimationRotatePirateShip::~CAnimationRotatePirateShip(void)
{
}

void CAnimationRotatePirateShip::Update(void)
{
	m_time++;
	m_time %= (192);

	if( ( m_time >= 0) && ( m_time < 48))
	{
		m_angle +=1.8;
	}
	else if( (m_time >= 48) && ( m_time < (96+48)) )
	{
		m_angle -= 1.8;
	}
	else if( ( m_time >= (96+48)) && ( m_time <= (192) ) )
	{
		m_angle += 1.8;
	}
	/*else if( (m_time >= 192) && ( m_time < (192+48)) )
	{
		m_angle += 2;
	}
	else if( ( m_time >= (192+48)) && ( m_time <= (192+96) ) )
	{
		m_angle -= 2;
	}*/
	/*else if( ( m_time >= (192)) && ( m_time <= (192+48) ) )
	{
		//m_angle += 1.8;
	}*/
	/*else if(( m_time >= 72) && ( m_time < (72+48)/2)  )
	{
		m_angle += 1;
	}*/
		

	m_node->SetAngle(m_angle);
}
